<include file="Base/header" />
<link href="__PUBLIC__/chosen/chosen.css" rel="stylesheet" />
<script src="__PUBLIC__/chosen/chosen.jquery.js"></script>  
<div class="page-container">
	<include file="Base/menu" />
	<div class="page-content">
		<div class="container-fluid">
			<div class="row-fluid">
				<div class="span12">
					<!-- BEGIN PAGE TITLE & BREADCRUMB-->
					<h3 class="page-title">
					</h3>
					<ul class="breadcrumb">
						<li>
							<i class="icon-home"></i>
							<a href="/index.php/Admin/">首页</a>
							<i class="icon-angle-right"></i>
						</li>
						<li><a href="/index.php/Admin/Company">服务进度管理</a></li>
					</ul>
					<!-- END PAGE TITLE & BREADCRUMB-->
				</div>
			</div>
			<div class="row-fluid">
			<div class="span12">
				<!-- BEGIN EXAMPLE TABLE PORTLET-->
				<div class="portlet box blue">
					<div class="portlet-title">
						<div class="caption"><i class="icon-globe"></i>服务进度列表</div>
						<div class="tools">
							<a href="javascript:;" class="collapse"></a>
							<a href="javascript:;" class="reload"></a>
							<a href="javascript:;" class="remove"></a>
						</div>
					</div>
					<div class="portlet-body">
						
						<div id="sample_1_wrapper" class="dataTables_wrapper form-inline" role="grid">
							<div class="row-fluid">
                            <form method="get" action="__URL__/index" >
							
							<div class="span5">
                                <div class="dataTables_filter" id="sample_1_filter">
                                    <label>客户: 
                                    <select name="shop_id" aria-controls="sample_1" class="m-wrap large shopId" onchange="submit(this.value)">
                                        <option value="">=请选择=</option>
                                        <foreach name="shop" item="v">
                                    <option value="{$v['id']}" <if condition="$v['id'] eq $shop_id">selected=selected</if>>{$v['shop_name']}</option>
                                </foreach>
                                    </select>
                                </div>
							</div>
                            <div class="span3">
                                <div id="sample_1_length" class="dataTables_length">
                                        <select id="mySelect" name="cate_id" aria-controls="sample_1" class="m-wrap small" onchange="submit(this.value)">
                                            <option value="0">请选择</option>
                                            <option value="1">捕飞虫等</option>
                                            <option value="2">鼠食盒</option>
                                            <option value="3">粘鼠板</option>
                                            <option value="4">机械捕鼠器</option>
                                            <option value="5">爬虫版</option>
                                        </select>
                                    </div>
                                </div>
                            </form>

                            <script>
                                $(".shopId").chosen({
                                    search_contains: true,
                                    no_results_text: "没有找到",
                                });
                            </script>
                            
						</div>
                        <div class="row-fluid" style="margin-top: 10px;margin-bottom: 10px;">
                                <div class="span3">须服务总数：{$count}</div>
                                <div class="span3">还未服务数：{$not_count}</div>
                            </div> 
<style type="text/css"> 
.top-green{
    background-color: #1d943b !important;
    height: 3px;
    width: 100%;
}
.medium-gray{background-color: #fff;height: 2px;width: 100%;}
.device-name{
    padding-top: 5px;
    padding-left: 5px;
    width: 100%;
    height: 100px;
}
.span2{border: 1px solid #eee;background-color: #eee;margin-bottom: 20px;}
#sample_1{background-color: #eee;}
.device-name .d-name{margin-top: 5px;margin-left: 5px;}
.device-name .d-time{margin-top: 5px;margin-left: 5px;}
.buttom-green{
    padding-top: 5px;
    padding-left: 5px;
    width: 100%;
    height: 20px;
}
.kao-left{float: left;margin-top: 5px;margin-left: 5px;color: #1d943b;}
.kao-right{float: right;margin-top: 5px;margin-right: 15px;}
</style>
<table class="table table-striped table-bordered table-hover dataTable" id="sample_1" aria-describedby="sample_1_info">

 <foreach name="data" item="vo">
       <div class="span2">
            <div class="top-green"></div>
            <div class="device-name">
                <div class="d-name">{$vo.name}</div>
                <div class="d-time">{$vo.add_time|getIntervalTime}</div>
                <div class="d-time">{$vo.a_time}</div>
            </div> 
            <div class="medium-gray"></div>
            <div class="buttom-green">
                <div class="kao-left">收集中</div>
                <div class="kao-right">{$vo.num}份数据</div>
            </div>
        </div>
    </foreach>
</table>
<div class="row-fluid">

    <div class="span6">
        <div class="dataTables_info" id="sample_1_info">
          共{$count}条数据记录。
        </div>
    </div>
    <div class="span6">
        <div class="dataTables_paginate paging_bootstrap pagination">
            {$page}
        </div>
    </div>
</div>
								</div>
							</div>
						</div>
						<!-- END EXAMPLE TABLE PORTLET-->
					</div>
				</div>
		</div>
	</div>
</div>
<include file="Base/footer" />
<script src="__PUBLIC__/plugins/layer/layer.min.js"></script>
<script type="text/javascript">

function del(id){
    layer.alert('确定删除？',function(close){
        pullRequest(id);
        layer.close(close);
    })
    function pullRequest(id){
        $.ajax({
            type:'POST',
            dataType: "json",
            url: "{:U('Admin/User/Delete')}",
            data: {"id":id},
            success:  function(result){
                if(result.status==1){
                    layer.alert(result.info,function(){self.location="__MODULE__/User/User_list";});
                }else if(result.status==0){
                    //失败
                    layer.alert(result.info);
                }
            }
        });
    }
} 
</script>
<script language="javascript" type="text/javascript">
/*function submit(){
    $.ajax({
        type:"get",
        url:"index?page_size",
        async:false,
    })
}*/

element=document.getElementById('page'+{$Think.session.page_size});
element.setAttribute("selected","selected");
</script>
